/*
 * httpnetworkcontext.h
 *
 *  Created on: Sep 20, 2011
 *      Author: anonovermind <anonovermind@gmail.com>
 */

#ifndef HTTPNETWORKCONTEXT_H_
#define HTTPNETWORKCONTEXT_H_

#include "networkcontext.h"
#include <map>
#include <list>

namespace Wishmaster2
{
namespace Network
{

class HttpNetworkContext : public Wishmaster2::Network::NetworkContext
{
public:
	HttpNetworkContext();
	virtual ~HttpNetworkContext();

	virtual void serialize(std::ostream& stream);
	virtual void deserialize(std::istream& stream);

	virtual void setParameters(const std::string& str);

	void addCookie(const std::string& domain, const std::string& name, const std::string& value);
	std::string cookieStringForDomain(const std::string& domain);

private:
	std::map<std::string, std::map<std::string, std::string> > m_cookies;
};

typedef std::shared_ptr<HttpNetworkContext> HttpNetworkContextPtr;
typedef std::weak_ptr<HttpNetworkContext> HttpNetworkContextWeakPtr;

} /* namespace Network */
} /* namespace Wishmaster2 */
#endif /* HTTPNETWORKCONTEXT_H_ */
